package AdminController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


import org.springframework.validation.BindException;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractCommandController;
import org.springframework.web.servlet.view.RedirectView;

import Bean.ReserBean;
import Dao.AdminDao;


public class ReserUpdate extends AbstractCommandController{
	private AdminDao dao;
	public void setAdminDao(AdminDao dao){
		this.dao=dao;
	}

	@Override
	protected ModelAndView handle(HttpServletRequest request,
			HttpServletResponse response, Object obj, BindException error)
			throws Exception {
	
		ReserBean reser = (ReserBean)obj;
		dao.reserUpdate(reser);
		
		ModelAndView mv=new ModelAndView();
//		mv.setViewName("reser_admin");
		mv.setView(new RedirectView("reservation.admin"));
		
		return mv;		

	}
}

